export const tryExecute = async (func, onError, defaultReturn) => {
    try {
        const result = await func()
        return result
    } catch (error) {
        typeof onError === 'function' && onError(error)
        return defaultReturn
    }
}